home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / OWLINC.PAK / EDITVIEW.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  3KB  |  128 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1992, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   10.4  $
  6. //
  7. // Definition of class TEditView
  8. //----------------------------------------------------------------------------
  9. #if !defined(OWL_EDITVIEW_H)
  10. #define OWL_EDITVIEW_H
  11.  
  12. #if !defined(OWL_DOCMANAG_H)
  13. # include <owl/docmanag.h>
  14. #endif
  15. #if !defined(OWL_EDITSEAR_H)
  16. # include <owl/editsear.h>
  17. #endif
  18.  
  19. #if defined(BI_NAMESPACE)
  20. namespace OWL {
  21. #endif
  22.  
  23. // Generic definitions/compiler options (eg. alignment) preceeding the 
  24. // definition of classes
  25. #include <services/preclass.h>
  26.  
  27. //
  28. // class TEditView
  29. // ~~~~~ ~~~~~~~~~
  30. class _OWLCLASS TEditView : public TEditSearch, public TView {
  31.   public:
  32.     TEditView(TDocument& doc, TWindow* parent = 0);
  33.    ~TEditView();
  34.     static const char far* StaticName();  // put in resource
  35.  
  36.     // Overridden virtuals from TView
  37.     //
  38.     const char far* GetViewName();
  39.     TWindow* GetWindow();
  40.     bool     SetDocTitle(const char far* docname, int index);
  41.  
  42.     // Overridden virtuals from TWindow
  43.     //
  44.     bool   Create();
  45.     void   PerformCreate(int menuOrId);
  46.     bool   CanClose();
  47.  
  48.   protected:
  49.     bool   LoadData();
  50.  
  51.     long   GetOrigin() const;
  52.     void   SetOrigin(long origin);
  53.  
  54.     // message response functions
  55.     //
  56.     void   EvNCDestroy();
  57.     bool   VnCommit(bool force);
  58.     bool   VnRevert(bool clear);
  59.     bool   VnIsWindow(HWND hWnd);
  60.     bool   VnIsDirty() ;
  61.     bool   VnDocClosed(int omode);
  62.  
  63.   protected_data:
  64.     long   Origin;
  65.  
  66.   DECLARE_RESPONSE_TABLE(TEditView);
  67.   DECLARE_STREAMABLE(_OWLCLASS, TEditView,1);
  68. };
  69.  
  70. // Generic definitions/compiler options (eg. alignment) following the 
  71. // definition of classes
  72. #include <services/posclass.h>
  73.  
  74. #if defined(BI_NAMESPACE)
  75. } // namespace OWL
  76. #endif
  77.  
  78. //----------------------------------------------------------------------------
  79. // Inline implementation
  80. //
  81.  
  82. //
  83. inline const char far* TEditView::StaticName() {
  84.   return "Edit View";
  85. }  // put in resource
  86.  
  87. //
  88. inline const char far* TEditView::GetViewName() {
  89.   return StaticName();
  90. }
  91.  
  92. //
  93. inline TWindow* TEditView::GetWindow() {
  94.   return (TWindow*)this;
  95. }
  96.  
  97. //
  98. inline bool TEditView::SetDocTitle(const char far* docname, int index) {
  99.   return TEditSearch::SetDocTitle(docname, index);
  100. }
  101.  
  102. //
  103. inline bool TEditView::CanClose() {
  104.   return TEditSearch::CanClose() && Doc->CanClose();
  105. }
  106.  
  107. //
  108. // Return the position of the stream buffer at which the edit buffer is stored.
  109. //
  110. inline long TEditView::GetOrigin() const {
  111.   return Origin;
  112. }
  113.  
  114. //
  115. // Sets the position of the stream buffer that the edit buffer is stored.
  116. //
  117. inline void TEditView::SetOrigin(long origin) {
  118.   Origin = origin;
  119. }
  120.  
  121. //
  122. inline bool TEditView::VnIsDirty() {
  123.   return TEditSearch::IsModified();
  124. }
  125.  
  126.  
  127. #endif  // OWL_EDITVIEW_H
  128.